home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
B-Book Series
/
(k)b4.d64
/
sec10.4.1c
< prev
next >
Wrap
Text File
|
2007-02-28
|
453b
|
17 lines
0010 DIM NAME$(0:11) OF 3, TEMP$ OF 3
0020 FOR K:=1 TO 11 DO READ NAME$(K)
0030 DATA "JIM","BEN","ZOE","PAT","VAL","KEN","RON","HAL","LEN","ALF","TOM"
0032 EN:=10
0034 REPEAT
0050 FOR PAIR:=1 TO EN DO
0060 IF NAME$(PAIR)>NAME$(PAIR+1) THEN SWAP
0070 ENDFOR PAIR
0080 UNTIL EN<=1
0090 FOR K:=1 TO 11 DO PRINT NAME$(K);" ";
0100 PROC SWAP
0105 EN:=PAIR
0110 TEMP$:=NAME$(PAIR)
0120 NAME$(PAIR):=NAME$(PAIR+1)
0130 NAME$(PAIR+1):=TEMP$
0140 ENDPROC SWAP